<?php

class Portlet extends CWidget
{
    // {{{ Members
    public $title;
    public $cssClass='portlet';
    public $header1CssClass='portlet-decoration';
    public $header2CssClass='portlet-title';
    public $contentCssClass='portlet-content';
    public $visible=true;
    // }}} 
    // {{{ init
    public function init()
    {
        /*
<div class="portlet" id="yw2">
    <div class="portlet-decoration">
        <div class="portlet-title">Operations</div>
    </div>
    <div class="portlet-content">
    </div>
</div>
    
         */        
        if(!$this->visible)
            return;
        echo "<div class=\"{$this->cssClass}\" id=\"{$this->id}\">\n";
        echo "\t<div class=\"{$this->header1CssClass}\">\n";
        if($this->title!==null)
            echo "\t\t<div class=\"{$this->header2CssClass}\">{$this->title}</div>\n";
        echo "\t</div>\n";
        echo "\t<div class=\"{$this->contentCssClass}\">\n";
    } // }}} 
    // {{{ run
    public function run()
    {
        if(!$this->visible)
            return;
        $this->renderContent();
        echo "\t</div><!-- {$this->contentCssClass} -->\n";
        echo "</div><!-- {$this->cssClass} -->";
    } // }}} 
    // {{{ renderContent
    protected function renderContent()
    {
    } // }}} 
}
